--- id: TASK-026 title: 'Preview: table backgrounds + H1 highlight don''t match theme paper' status: "\U0001F3C1 Done" assignee: [] created_date: '2026-06-29 22:55' updated_date: '2026-06-29 23:12' labels: - bug dependencies: [] priority: medium ordinal: 26000 --- ## Description Two glamour preview theming bugs: 1) Table cell padding and border glyphs (│ ┼ ─) rendered with no background → fell back to the terminal-default bg, mismatching the theme paper (worse across themes). Inline-code cells also showed dark blocks. 2) H1 heading background bar only painted the prefix/suffix margins, not behind the heading text — the word sat on paper bg because applyTheme forced the Text background to paper, overriding the H1 block bg for the heading's child text. Fix (internal/preview/preview.go): applyTheme now clears all backgrounds and sets only Document/Code/CodeBlock/Table = paper, leaving Text bg unset so heading text inherits the H1 heading bg. Added fillBackground() to re-assert paper bg after every ANSI reset and at line starts, so unstyled gaps (borders, padding) render on paper. Applied to the theme-driven styles only. ## Acceptance Criteria - [x] #1 H1 heading background fills behind the heading text, not just the margins - [x] #2 Table cell padding and borders render on the theme paper across all themes - [x] #3 Inline code in cells uses paper bg (no dark blocks) - [x] #4 Regression tests cover H1 bg and post-reset paper re-assert ## Implementation Notes Follow-up: real-terminal bleed where unstyled regions adopted the TERMINAL bg (cream-over-dark / dark-over-light). Root: glamour/viewport emit bare \x1b[m resets and viewport padding added AFTER Render. Fixed by re-asserting paper after bare resets too and moving fillBackground to View(). Also left Text.Color unset so H1 text is legible (uses legibleText on the heading bar). 2 more tests. (commit qkvsmknk)